package delegateModule.component;

import java.sql.Connection;
import java.util.ArrayList;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.component.SaturnData;
import edu.ccut.saturn.workflow.common.WorkFlowTools;

public class GetDelegateToUserList extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		String delegate_to = (String)parameterContext.getParameterValue(0);
		String delegate_to_user_type = (String)parameterContext.getParameterValue(1);
		Connection conn = parameterContext.getConnection();
		ArrayList<SaturnData> userDataList = WorkFlowTools.getUserDataListByTypeAndId(
						delegate_to_user_type, delegate_to, conn);	
		parameterContext.setParameter(2, userDataList);
	}
}